package com.edu.demo.dao;

import com.edu.demo.entity.UserBean;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @author XYH
 * date 2024-03-09
 */

@Mapper
public interface IRegisterDao {
    @Insert("INSERT INTO users (username, password,email) VALUES(#{email},#{password},#{email})")
    int insertUser(UserBean userBean);

    @Insert("INSERT INTO users (username,salt,password,phone) VALUES(#{phone},#{salt},#{password},#{phone})")
    int insertUserByPhone(UserBean userBean);

    @Select("SELECT * FROM users WHERE phone = #{phone}")
    UserBean selectByPhone(UserBean userBean);
}
